#include<iostream>
#include<algorithm>
using namespace std;
const int N = 2e6 + 10;
int arr[N];
int main()
{
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + m);
	for (int i = 0; i < m; i++) {
		cout << arr[i] << " ";
	}
	return 0;
}